#!/usr/bin/python
#coding:utf-8

class Operation:
    def GetResult(self):
        pass

class OperationAdd(Operation):
    def GetResult(self):
        return self.op1 + self.op2

class OperationSub(Operation):
    def GetResult(self):
        return self.op1 - self.op2

class OperationUndef(Operation):
    def GetResult(self):
        return "未定义的操作符。"

class OperationFactory:
    operation = {}
    operation['+'] = OperationAdd()
    operation['-'] = OperationSub()
    def createObj(self, ch):

        if ch in self.operation:
            return self.operation[ch]
        else:
            return OperationUndef()

if __name__ == "__main__":
    while 1:
        op = raw_input("输入操作符:".decode("utf-8").encode("gbk"))
        op1 = input("第一个值".decode("utf-8").encode("gbk"))
        op2 = input("第二个值".decode("utf-8").encode("gbk"))
        factoryobj = OperationFactory()
        cal = factoryobj.createObj(op)
        cal.op1 = op1
        cal.op2 = op2
        print cal.GetResult().decode("utf-8").encode("gbk")